// =============================================================
// CFactoryContainer class
// ---------------------------------------
// Author : Woo-Hyun Kim
// Email : woorung@icu.ac.kr or woorung@nhncorp.com
// Date : Aug. 30, 2007
// =============================================================
#ifndef CServiceContainerH
#define CServiceContainerH
//-----------------------------------------------------------------
#include <iostream>
#include <iterator>
#include <string>
#include <vector>

#include "CService.h"

using namespace std;

class CServiceContainer
{
private:
	vector<CService *> services;

protected:
	// two methods must be overridden in subclasses
	virtual int activate(CService *service) = 0;
	virtual int inactivate(CService *service) = 0;

public:
	CFactoryService *factory;

        CServiceContainer();
        virtual ~CServiceContainer();

        int plugin(CService *service);
        int plugout(char *name);

        CService *getService(char *name);

        virtual void runCGI();
        virtual void run();
};
#endif
